-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AddChain inbound CCIP integration test #14377
AddChain inbound CCIP integration test #14377
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are FeeQuoter and PriceRegistry references used alternatively, can we make it uniform?
} | ||
js, err := ccipdeployment.NewCCIPJobSpecs(env.NodeIDs, env.Offchain) | ||
if err != nil { | ||
return deployment.ChangesetOutput{}, err | ||
} | ||
proposal, err := ccipdeployment.GenerateAcceptOwnershipProposal(env, env.AllChainSelectors(), ab) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be its own changeset, probably too much to deploy all the contracts and accept ownership in the same one
if _, err := deployment.ConfirmIfNoError(h, tx, err); err != nil { | ||
return ccip_config.CCIPConfigTypesChainConfigInfo{}, err | ||
} | ||
lggr.Infow("Applied chain config updates", "chainConfig", chainConfig) | ||
return chainConfig, nil | ||
} | ||
|
||
func AddDON( | ||
// AddDONToCR adds a DON with the given nodes to the capabilities registry. | ||
func BuildAddDONArgs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need helpers for constructing the args in the case where we want to use SimTransactOpts to build proposal data
return encodedConfigs, nil | ||
} | ||
|
||
func LatestCCIPDON(registry *capabilities_registry.CapabilitiesRegistry) (*capabilities_registry.CapabilitiesRegistryDONInfo, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing events is more annoying when the don is added as part of proposal, so using this to get the donID in the case where you know precisely one don was added.
return ab, err | ||
} | ||
groupQuorums, groupParents, signerAddresses, signerGroups := c.ExtractSetConfigInputs() | ||
mcmsTx, err := mcm.Contract.SetConfig(chain.DeployerKey, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a 1of1 with the test key for now. Need to parameterize in a follow up.
var ( | ||
// TODO: sort out why the mismatch here | ||
//CCIPCapabilityId [32]byte = utils.MustHash(hexutil.Encode(MustABIEncode(`[{"type": "string"}, {"type": "string"}]`, CapabilityLabelledName, CapabilityVersion))) | ||
CCIPCapabilityId = MustHashFromBytes(hexutil.MustDecode("0xe0da3c2b9005178f4731c9f40164f1933ad00bac9d6c13ad4ca1a8a763416380")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just avoids RPC calls all the time to get the capability ID. We expect it to be fixed per version
) (ccip_config.CCIPConfigTypesChainConfigInfo, error) { | ||
// Need to sort, otherwise _checkIsValidUniqueSubset onChain will fail | ||
sortP2PIDS(p2pIDs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorting these once in the helper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorting no longer needed, can remove it entirely
[]mcms.Signature{}, | ||
false, | ||
metaDataPerChain, | ||
"blah", // TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit : ticket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part of CCIP-3411 too
// NOTE: Assume same peerID/multiAddr for all chains. | ||
// Might make sense to change proto as peerID/multiAddr is 1-1 with nodeID? | ||
peerID = MustPeerIDFromString(chainConfig.Ocr2Config.P2PKeyBundle.PeerId) | ||
multiAddr = chainConfig.Ocr2Config.Multiaddr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The multiaddr is only populated for bootstrap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, will it cause issues if it was set for non bootstrap nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think leaving it blank for non-bootstraps is ok for now. @asoliman92 no don't think it will
metaDataPerChain := make(map[mcms.ChainIdentifier]timelock.MCMSWithTimelockChainMetadata) | ||
for _, source := range sources { | ||
chain, _ := chainsel.ChainBySelector(source) | ||
enableOnRampDest, err := state.Chains[source].OnRamp.ApplyDestChainConfigUpdates(SimTransactOpts(), []onramp.OnRampDestChainConfigArgs{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually "send" the tx to the simchain? Proposals just need calldata right? I'm wondering what'll happen here for the non-sim chains which have "automine" or similar on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't - uses the NoSend
flag in transact opts, just a scalable way to get the calldata for proposals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's clever, alright did not notice that
}, | ||
}) | ||
return timelock.NewMCMSWithTimelockProposal( | ||
"1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments on string/bool/int literal fields would be useful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah lets punt to CCIP-3411
|
||
// Transfer onramp/fq ownership to timelock. | ||
// Enable the new dest on the test router. | ||
for _, source := range initialDeploy { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semantically distinct code blocks below (already designated by comments) can probably be moved to functions to make this test read/understand better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree - was thinking we wait for another proposal to see if there are nice re-usable utilities we can extract
// TODO: The offchain code doesn't yet support partial lane | ||
// enablement, need to address then re-enable this test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is needed still for offchain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing now if the IsEnabled flag work is done, then we can complete this test
) (ccip_config.CCIPConfigTypesChainConfigInfo, error) { | ||
// Need to sort, otherwise _checkIsValidUniqueSubset onChain will fail | ||
sortP2PIDS(p2pIDs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorting no longer needed, can remove it entirely
Quality Gate passedIssues Measures |
* Port * Use mcms lib * Proposal signing working * Almost working. Just need ramps to make timelock owner first * Accept ownership proposal working * Fee quoter accept ownership * Fix existing tests * Enable to new chain traffic working * Mod tidy * Fix build * lint * More lint * Use Address() for MCM/Timelock * Rename * Self review cleanup * Clean up job management and bootstrap handling * Comments
* Port * Use mcms lib * Proposal signing working * Almost working. Just need ramps to make timelock owner first * Accept ownership proposal working * Fee quoter accept ownership * Fix existing tests * Enable to new chain traffic working * Mod tidy * Fix build * lint * More lint * Use Address() for MCM/Timelock * Rename * Self review cleanup * Clean up job management and bootstrap handling * Comments
CCIP-3062
Follow ups: